package cc.wubo.jpa;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import cc.wubo.jpa.entity.User;
import cc.wubo.jpa.repository.UserRepository;
@SpringBootApplication
@EntityScan(basePackages="cc.wubo.jpa.entity")
@EnableJpaRepositories(basePackages="cc.wubo.jpa.repository")
public class App {
	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
		UserRepository ur = context.getBean(UserRepository.class);
		
		User user = new User();
		user.setName("默默大");
		user.setVersion(1);
		ur.save(user);
		context.close();
	}

}
